﻿Module ModuloClasesPersonas
    Public Function generarCodigo(ByVal nombre As String) As String
        Return Now().Year & Now.Month & Now.Day & Now.Hour & Now.Minute & Now.Second
    End Function

    Public Class Persona
        Dim codigo As String
        Dim nombre As String
        Public Function getNombre() As String
            Return nombre
        End Function
        Public Sub New(ByVal n As String)
            nombre = n
            codigo = generarCodigo(nombre)
        End Sub
    End Class

    Public Class Empleado
        Inherits Persona
        Dim usuario As String
        Public esAdmin As Boolean
        Dim password As String = "12341234"
        Public Sub setPassword(ByVal pass As String)
            password = pass
        End Sub
        Public Function getPassword() As String
            Return password
        End Function
        Public Sub New(ByVal nombre As String, ByVal usuario As String)
            MyBase.New(nombre)
            Me.usuario = usuario
            esAdmin = False
        End Sub
        Public Sub New(ByVal nombre As String, ByVal usuario As String, ByVal admin As Boolean)
            Me.New(nombre, usuario)
            esAdmin = admin
        End Sub
    End Class

    Public Class Cliente
        Inherits Persona
        Dim telefono As String
        Dim bono() As bono
        Public Sub New(ByVal nombre As String, ByVal telefono As String)
            MyBase.New(nombre)
            Me.telefono = telefono
        End Sub
    End Class



End Module
